from django.db import models


class Shops(models.Model):
    """
    店铺信息表
    """

    name_of_shop = models.CharField(max_length=200)  # 店铺名
    shop_id = models.IntegerField(primary_key=True)  # 店铺id
    shop_brief_introduction = models.CharField(max_length=200)  # 店铺简介

    class Meta:
        db_table = "Shops"


class ProductInformation(models.Model):
    """
    商品信息表
    """

    product_id = models.IntegerField(primary_key=True)  # 商品id, 唯一
    product_name = models.CharField(max_length=200)  # 商品名称, 存在重名商品
    shop_id = models.IntegerField()  # 商品所属的店铺id
    product_price = models.FloatField()  # 产品价格
    product_inventory = models.IntegerField()  # 产品库存
    product_brief_introduction = models.CharField(max_length=200)  # 产品简介
    product_picture = models.CharField(max_length=200)  # 产品图片的链接

    class Meta:
        db_table = "ProductInformation"
